#include "MessageUpDownTimer.h"

use_logging_cpp(MessageUpDownTimer)

MessageUpDownTimer::MessageUpDownTimer( AribaNode* _parent )
	 : app(_parent)
{
	up = 0;
	down = 0;
} // MessageUpDownTimer

MessageUpDownTimer::~MessageUpDownTimer()
{

} // ~MessageUpDownTimer

void MessageUpDownTimer::eventFunction()
{
	app->MessageUpDownTimerEvent();
}

bool MessageUpDownTimer::getUpFlag()
{
	return up;
}

bool MessageUpDownTimer::getDownFlag()
{
	return down;
}

void MessageUpDownTimer::setUpFlag(bool _up)
{
	up = _up;
}

void MessageUpDownTimer::setDownFlag(bool _down)
{
	down = _down;
}

//bool upDown (1 == up, 0 == down)
bool MessageUpDownTimer::isFlagSet(bool upDown)
{
	if(upDown)
		return up;
	else
		return down;
}

//bool upDown (1 == up, 0 == down)
void MessageUpDownTimer::setFlag(bool upDown)
{
	if(upDown)
		up = 1;
	else
		down = 1;
}

//return (1 == up, 0 == down)
bool MessageUpDownTimer::getFlag()
{
	if(up)
		return 1;
	else
		return 0;
}

void MessageUpDownTimer::clearFlag(bool upDown)
{
	if(upDown)
		up = 0;
	else
		down = 0;
}
